package co.edu.unal.satacredito.administration.view.establishment;

import java.util.List;
import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import co.edu.unal.satacredito.administration.view.general.AdministrationBean;
import co.edu.unal.satacredito.infrastructure.dto.EstablishmentDTO;
import co.edu.unal.satacredito.mediation.EstablishmentEJBLocal;

@ManagedBean(name = "list_Establishment")
public class ListEstablishment extends AdministrationBean {

	private List<EstablishmentDTO> establishments;
	
	@EJB
	EstablishmentEJBLocal establishmentEJB;
	
	@PostConstruct
	public void init(){
		this.establishments = establishmentEJB.findAllEstablishment();
	}
	
	public String getAllEstablishment() {	
		return LIST_ESTABLISHMENTS;
	}
	
	public List<EstablishmentDTO> getEstablishments(){
		return establishments;
	}

}
